package com.spring.applicationEvent_demo;

import org.springframework.context.ApplicationListener;


public class BlackListNotifier implements ApplicationListener<BlackListEvent> {

	private String notificationAddress;

	public void setNotificationAddress(String notificationAddress) {
		this.notificationAddress = notificationAddress;
	}

	public void onApplicationEvent(BlackListEvent event) {
		// notify appropriate parties via notificationAddress...
		String address = event.getAddress();
		String content = event.getContent();
		System.out.println("I have received your msg:");
		System.out.println(address);
		System.out.println(content);
	}
}